/**
 * Created by Administrator on 2016/8/11 0011.
 */
var MyComponent = Vue.extend({
  template: [
    '<div>{{msg}}</div>',
    '<div>{{items}}</div>',
    '<table class="table table-bordered table-condensed table-striped" style="word-break:break-all">',
    '<br/>',
    '<thead>',
    '<tr class="info" >',
    '<th>选择</th> <th>唯一标识</th> <th>负责人</th> <th>描述</th> <th>截止期</th> <th>状态</th> <th>操作</th>',
    '</tr>',
    '</thead>',
    '<tbody>',
    '<tr v-for="item in items" track-by="$index" >',
    '<td><input type="checkbox" v-model="item.selected"></td>',
    '<td width="18%"><a href="#" >{{item.id}} </a></td>',
    '<td width="5%">{{item.principal}}</td>',
    '<td width="50%">{{item.description}}</td>',
    '<td width="12%">{{item.deadline}}</td>',
    '<td v-if="item.state==0">未完成</td>',
    '<td v-if="item.state==1" >执行中</td>',
    '<td v-if="item.state==9">已完成</td>',
    '<td>',
    '<a href="#" v-on:click="onRemoveItem(item,$event)"> 删除 </a> |',
    '<a href="#" v-on:click="onEditItem(item,$event)"> 编辑 </a>',
    '</td>',
    '</tr>',
    '</tbody>',
    '</table>'].join(''),
  props: [
    {
      name: 'items',
      twoWay: false,
      required: true
    },
    {
      name: 'msg',
      //required: true,
    },
    {
      name: 'properties',
    }
  ],
  data: function () {
    return {
      result: null
    };
  },
 /* props: {
    items: [],
    msg: {},

  },*/
  ready: function () {
  }
  /*
   props: ['msg', 'items', 'properties']
   */
})

// 注册
Vue.component('itemlist', MyComponent)
// 创建根实例
new Vue({
 el: '#res',
 data: {
/*   result:{
     return:items
   },*/
   items:[],
 },
 methods: {},
 ready: function () {
 }
 })
